home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / button.z / button
Text File  |  1998-10-30  |  13KB  |  265 lines

  1.  
  2.  
  3.  
  4. bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                        bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      button - Create and manipulate button widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      bbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               ccccuuuurrrrssssoooorrrr          hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssssttttaaaakkkkeeeeFFFFooooccccuuuussss|
  16.      aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd               ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnnddddiiiimmmmaaaaggggeeeetttteeeexxxxtttt               |
  17.      aaaannnncccchhhhoooorrrr          ffffoooonnnntttt           jjjjuuuussssttttiiiiffffyyyy         tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee              |
  18.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ffffoooorrrreeeeggggrrrroooouuuunnnndddd     ppppaaaaddddXXXX            uuuunnnnddddeeeerrrrlllliiiinnnneeee                 |
  19.      bbbbiiiittttmmmmaaaapppp          hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr ppppaaaaddddYYYY            wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh                |
  20.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd            rrrreeeelllliiiieeeeffff
  21.  
  22.      See the ``options'' manual entry for details on the standard options.
  23.  
  24. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  25.      Name:           ccccoooommmmmmmmaaaannnndddd
  26.      Class:          CCCCoooommmmmmmmaaaannnndddd
  27.      Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  28.  
  29.           Specifies a Tcl command to associate with the button.  This command
  30.           is typically invoked when mouse button 1 is released over the button
  31.           window.
  32.  
  33.      Name:           hhhheeeeiiiigggghhhhtttt
  34.      Class:          HHHHeeeeiiiigggghhhhtttt
  35.      Command-Line Switch:----hhhheeeeiiiigggghhhhtttt
  36.  
  37.           Specifies a desired height for the button.  If an image or bitmap is
  38.           being displayed in the button then the value is in screen units
  39.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is
  40.           in lines of text.  If this option isn't specified, the button's
  41.           desired height is computed from the size of the image or bitmap or
  42.           text being displayed in it.
  43.  
  44.      Name:           ssssttttaaaatttteeee
  45.      Class:          SSSSttttaaaatttteeee
  46.      Command-Line Switch:----ssssttttaaaatttteeee
  47.  
  48.           Specifies one of three states for the button:  nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee, or
  49.           ddddiiiissssaaaabbbblllleeeedddd.  In normal state the button is displayed using the
  50.           ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options.  The active state is typically
  51.           used when the pointer is over the button.  In active state the
  52.           button is displayed using the aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd
  53.           options.  Disabled state means that the button should be            |
  54.           insensitive:  the default bindings will refuse to activate the      |
  55.           widget and will ignore mouse button presses.  In this state the
  56.           ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options determine how the button
  57.           is displayed.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                        bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      Name:           wwwwiiiiddddtttthhhh
  75.      Class:          WWWWiiiiddddtttthhhh
  76.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  77.  
  78.           Specifies a desired width for the button.  If an image or bitmap is
  79.           being displayed in the button then the value is in screen units
  80.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is
  81.           in characters.  If this option isn't specified, the button's desired
  82.           width is computed from the size of the image or bitmap or text being
  83.           displayed in it.
  84.  
  85.  
  86. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  87.      The bbbbuuuuttttttttoooonnnn command creates a new window (given by the _p_a_t_h_N_a_m_e argument)
  88.      and makes it into a button widget.  Additional options, described above,
  89.      may be specified on the command line or in the option database to
  90.      configure aspects of the button such as its colors, font, text, and
  91.      initial relief.  The bbbbuuuuttttttttoooonnnn command returns its _p_a_t_h_N_a_m_e argument.  At
  92.      the time this command is invoked, there must not exist a window named
  93.      _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  94.  
  95.      A button is a widget that displays a textual string, bitmap or image.  If|
  96.      text is displayed, it must all be in a single font, but it can occupy    |
  97.      multiple lines on the screen (if it contains newlines or if wrapping     |
  98.      occurs because of the wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh option) and one of the characters may   |
  99.      optionally be underlined using the uuuunnnnddddeeeerrrrlllliiiinnnneeee option.  It can display
  100.      itself in either of three different ways, according to the ssssttttaaaatttteeee option;
  101.      it can be made to appear raised, sunken, or flat; and it can be made to
  102.      flash.  When a user invokes the button (by pressing mouse button 1 with
  103.      the cursor over the button), then the Tcl command specified in the
  104.      ----ccccoooommmmmmmmaaaannnndddd option is invoked.
  105.  
  106.  
  107. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  108.      The bbbbuuuuttttttttoooonnnn command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.
  109.      This command may be used to invoke various operations on the widget.  It
  110.      has the following general form:
  111.  
  112.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  113.  
  114.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  115.      following commands are possible for button widgets:
  116.  
  117.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  118.           Returns the current value of the configuration option given by      |
  119.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the bbbbuuuuttttttttoooonnnn   |
  120.           command.
  121.  
  122.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  123.           Query or modify the configuration options of the widget.  If no
  124.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  125.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                        bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  141.           the command returns a list describing the one named option (this
  142.           list will be identical to the corresponding sublist of the value
  143.           returned if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e
  144.           pairs are specified, then the command modifies the given widget
  145.           option(s) to have the given value(s);  in this case the command
  146.           returns an empty string.  _O_p_t_i_o_n may have any of the values accepted
  147.           by the bbbbuuuuttttttttoooonnnn command.
  148.  
  149.      _p_a_t_h_N_a_m_e ffffllllaaaasssshhhh
  150.           Flash the button.  This is accomplished by redisplaying the button
  151.           several times, alternating between active and normal colors.  At the
  152.           end of the flash the button is left in the same normal/active state
  153.           as when the command was invoked.  This command is ignored if the
  154.           button's state is ddddiiiissssaaaabbbblllleeeedddd.
  155.  
  156.      _p_a_t_h_N_a_m_e iiiinnnnvvvvooookkkkeeee
  157.           Invoke the Tcl command associated with the button, if there is one.
  158.           The return value is the return value from the Tcl command, or an
  159.           empty string if there is no command associated with the button.
  160.           This command is ignored if the button's state is ddddiiiissssaaaabbbblllleeeedddd.
  161.  
  162.  
  163. DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  164.      Tk automatically creates class bindings for buttons that give them the
  165.      following default behavior:
  166.  
  167.      [1]  A button activates whenever the mouse passes over it and deactivates
  168.           whenever the mouse leaves the button.
  169.  
  170.      [2]  A button's relief is changed to sunken whenever mouse button 1 is
  171.           pressed over the button, and the relief is restored to its original
  172.           value when button 1 is later released.
  173.  
  174.      [3]  If mouse button 1 is pressed over a button and later released over
  175.           the button, the button is invoked.  However, if the mouse is not
  176.           over the button when button 1 is released, then no invocation
  177.           occurs.
  178.  
  179.      [4]  When a button has the input focus, the space key causes the button  |
  180.           to be invoked.
  181.  
  182.      If the button's state is ddddiiiissssaaaabbbblllleeeedddd then none of the above actions occur:
  183.      the button is completely non-responsive.
  184.  
  185.      The behavior of buttons can be changed by defining new bindings for
  186.      individual widgets or by redefining the class bindings.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                        bbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206. KEYWORDS
  207.      button, widget
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.